with open('pi_digits.txt') as file_object:
     #contents = file_object.read() #read方法读取文件全部内容
# print(contents.rstrip())
#     for line in file_object:  #逐行读取
#         print(line.rstrip())
    lines = file_object.readlines()

for line in lines:
    print(line.rstrip())